<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                        <i class="fa  fa-fw fa-reorder"></i>用户管理
                        </li>
                    </ol>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <!--<a class="" href="javascript:void(0);"></a>-->
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-success" id="default">默认</button>
                </div>
                <div class="col-md-6">
                    <form method="post" action="/admin_user">
                        <div class="form-group input-group">
                        <input type="text" placeholder="请输入姓名或者手机号关键字" value="<?=$pKey?>" name="key" class="form-control">
                        <span class="input-group-btn">
                          <button type="button" class="btn btn-default" id="search"><i class="fa fa-search"></i></button>
                        </span>
                        </div>
                    </form>
                </div>
            </div>

            <div class="panel-body text-center">
                <table class="table table-hover" id="sample-table-1">
                    <thead>
                        <tr>
                            <td>编号</td>
                            <td>手机号</td>
                            <td>姓名</td>
                            <td>证件类型</td>
                            <td>证件号码</td>
                            <td>用户等级</td>
                            <td>注册时间</td>
							<!--<td>是否开放线上理赔</td>-->
                        </tr>
                    </thead>
                    <?foreach($tDatas as $tRow){?>
                    <tr>
                        <td><?=$tRow['id']?></td>
                        <td><?=$tRow['phone']?></td>
                        <td><?=$tRow['name']?></td>
                        <td><?=$tRow['crittype_info']?></td>
                        <td><?=$tRow['critcode']?></td>
                        <td><?=empty($tRow['insuredgrade'])?'普通':'VIP'?></td>
                        <td><?=date('Y-m-d H:i:s',$tRow['reg_time'])?></td>
						<!--<td><input type="radio" name="authorization<?=$tRow['id']?>" s="<?=$tRow['id']?>" value="0" <?php if($tRow['authorization'] == '0'){ echo 'checked';}?>/>是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" s="<?=$tRow['id']?>" name="authorization<?=$tRow['id']?>" value="1" <?php if($tRow['authorization'] == '1'){ echo 'checked';}?>/>否</td>-->
                    </tr>
                    <?}?>
                </table>
                <?=$tShow?>
            </div>
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>
<!-- end: MAIN CONTAINER -->

<script>
$('#search').click(function(){
    $('form').submit();
});
$('#default').click(function(){
    window.location.href="/admin_user";
});
$('input[type="radio"]').each(function(){
	$(this).on('click',function(){
		var authorization = $(this).val();
		var tId = $(this).attr('s');
		$.post('/admin_user/',{ "authorization":authorization,"tId":tId },function(obj){alert(obj.msg);location.href="/admin_user/"});
	});	
});
</script>
<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
